package com.hxz.pojo;

import org.springframework.context.Lifecycle;
import org.springframework.context.LifecycleProcessor;
import org.springframework.context.SmartLifecycle;

/**
 * @Description
 * @Author 86199
 * @Date 2021/6/30 9:16
 */
public class LifecycleBean implements SmartLifecycle {
    private volatile boolean running = false;
    @Override
    public void start() {
        running=true;
        System.out.println("LifecycleBean开始方法");
    }

    @Override
    public void stop() {
        running=false;
        System.out.println("LifecycleBean结束方法");
    }

    @Override
    public boolean isRunning() {
        return running;
    }
}
